//
//  explainViewHandle.m
//  UILbrary
//
//  Created by Apple on 2022/5/14.
//  Copyright © 2022 mac. All rights reserved.
//

#import "ExplainViewHandle.h"
#import "Masonry.h"
@interface ExplainViewHandle()

@property (nonatomic, strong) UITextView *textView;
@property (nonatomic, copy) NSString *title;

@end


@implementation ExplainViewHandle

//MARK: - public

- (UIView *)view
{
    return self.textView;
}

- (void)configText:(NSString *)text
{
    self.textView.text = text;
}


- (void)addToView:(UIView *)view
{
    [view addSubview:self.textView];
    [self.textView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(view.mas_topMargin).offset(10);
        make.left.mas_equalTo(view).offset(10);
        make.right.mas_equalTo(view).offset(-10);
        make.height.mas_equalTo(100);
    }];
}

//MARK: - get

- (UITextView *)textView
{
    if (!_textView) {
        UITextView *textView = [UITextView new];
        textView.layer.borderWidth = 0.5;
        textView.layer.borderColor = [UIColor redColor].CGColor;
        _textView = textView;
    }
    return _textView;
}


@end
